package com.detoandy.controller;

import com.detoandy.model.User;
import com.detoandy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by zhengdt on 2017/8/17.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getUserById/{id}")
    public User getUserById(@PathVariable String id) {
        return userService.getUserById(id);
    }

    @PostMapping("/updateUser")
    public void updateUser(@RequestBody  User user) {
        userService.updateUser(user);
    }

}
